﻿<Window x:Class="XSemmel.TcpListener.TcpListeningWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:AvalonEdit="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
        xmlns:fluent="clr-namespace:Fluent;assembly=Fluent"
        fluent:RibbonProperties.TitleBarHeight="0"
        Title="Listening to TCP stream" Height="350" Width="525" MinHeight="150" MinWidth="250"
        Icon="/Images/Document_TCP_16x16.png" >
    <DockPanel>
        <fluent:Ribbon DockPanel.Dock="Top">

            <fluent:RibbonTabItem Header="TCP">

                <fluent:RibbonGroupBox Header="Interaction" Icon="/Images/arrow_start_32x32.png">
                    <fluent:Button
                        Header="Append to editor"
                        ToolTip="Append to editor"
                        LargeIcon="/Images/arrow_start_32x32.png"
                        Click="mnuAppendToEditor_Click"
                    />
                    <fluent:Button
                        Header="Append trimmed &amp; prettyprinted" 
                        ToolTip="Append trimmed &amp; prettyprinted to editor" 
                        LargeIcon="/Images/appendPrettyprinted_32x32.png"
                        Click="mnuAppendToEditorAndPrettyprint_Click"
                    />
                    <fluent:Button
                        Header="Copy to clipboard" 
                        ToolTip="Copy to clipboard" 
                        Icon="/Images/Copy.png"
                        SizeDefinition="Middle, Small"
                        Click="mnuCopyToClipboard_Click"
                    />
                    <fluent:Button
                        Header="Save as..."
                        ToolTip="Save as..."
                        Icon="\Images\SaveAsHH.png"
                        SizeDefinition="Middle, Small"
                        Click="mnuSaveAs_Click"
                    />
                    <fluent:Button
                        Header="Open in new Xsemmel" 
                        ToolTip="Open in new Xsemmel" 
                        Icon="\AppIcon.ico"
                        SizeDefinition="Middle, Small"
                        Click="mnuOpenInNewXSemmel_Click"
                    />
                </fluent:RibbonGroupBox>

                <fluent:RibbonGroupBox Header="View" Icon="/Images/View_32x32.png">
                    <fluent:Button
                        Header="Clear all" 
                        ToolTip="Clear all" 
                        Icon="/Images/Delete_16x16.png" 
                        LargeIcon="/Images/Delete_32x32.png" 
                        Click="btnClear_OnClick"
                    />
                    <fluent:CheckBox
                        x:Name="_btnWordWrap" x:FieldModifier="private"
                        Header="WordWrap"
                        ToolTip="WordWrap"
                        SizeDefinition="Middle, Small"
                        IsChecked="False"
                    />
                    <fluent:CheckBox
                        Checked="chkShowSpecialCharacters_Click"
                        Unchecked="chkShowSpecialCharacters_Click"
                        Header="Special chars"
                        ToolTip="Show special characters"
                        SizeDefinition="Middle, Small"
                        IsChecked="True"
                    />
                </fluent:RibbonGroupBox>
            
            </fluent:RibbonTabItem>
        </fluent:Ribbon>

        <StatusBar DockPanel.Dock="Bottom" Height="23">
            <TextBlock x:Name="_lblStatus" x:FieldModifier="private" />
            <TextBlock x:Name="_lblLastReceived" x:FieldModifier="private" Margin="15 0 0 0" />
        </StatusBar>

        <Border DockPanel.Dock="Top" Height="7" BorderBrush="Black" BorderThickness="0,1,0,0">
            <Border.Effect>
                <DropShadowEffect Direction="270" ShadowDepth="1" />
            </Border.Effect>
        </Border>

        <AvalonEdit:TextEditor x:Name="_edtResult" x:FieldModifier="private"
            IsReadOnly="True" FontFamily="Consolas"
            FontSize="10pt" SyntaxHighlighting="XML" ShowLineNumbers="True"
            WordWrap="{Binding IsChecked, ElementName=_btnWordWrap}"
        >
            <AvalonEdit:TextEditor.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Copy to clipboard" Click="mnuCopyToClipboard_Click"/>
                    <MenuItem Header="Append to editor" Click="mnuAppendToEditor_Click"/>
                    <MenuItem Header="Append trimmed &amp; prettyprinted to editor" Click="mnuAppendToEditorAndPrettyprint_Click"/>
                    <MenuItem Header="Open in new Xsemmel" Click="mnuOpenInNewXSemmel_Click"/>
                </ContextMenu>
            </AvalonEdit:TextEditor.ContextMenu>
        </AvalonEdit:TextEditor>

    </DockPanel>
</Window>
